Operating System Design: The Xinu Approach, Second Edition

Operating System Design: The Xinu Approach, Second Edition

Language: English

Pages: 701

ISBN: 1498712436

Format: PDF / Kindle (mobi) / ePub


An Update of the Most Practical A-to-Z Operating System Book

Widely lauded for avoiding the typical black box approach found in other operating system textbooks, the first edition of this bestselling book taught readers how an operating system works and explained how to build it from the ground up.

Continuing to follow a logical pattern for system design, Operating System Design: The Xinu Approach, Second Edition removes the mystery from operating system design and consolidates the body of material into a systematic discipline. It presents a hierarchical design paradigm that organizes major operating system components in an orderly, understandable manner.

The book guides readers through the construction of a conventional process-based operating system using practical, straightforward primitives. It gives the implementation details of one set of primitives, usually the most popular set. Once readers understand how primitives can be implemented on conventional hardware, they can then easily implement alternative versions.

The text begins with a bare machine and proceeds step-by-step through the design and implementation of Xinu, which is a small, elegant operating system that supports dynamic process creation, dynamic memory allocation, network communication, local and remote file systems, a shell, and device-independent I/O functions. The Xinu code runs on many hardware platforms. This second edition has been completely rewritten to contrast operating systems for RISC and CISC processors. Encouraging hands-on experimentation, the book provides updated code throughout and examples for two low-cost experimenter boards: BeagleBone Black from ARM and Galileo from Intel.

Brief Principles of Macroeconomics

Sociology in Our Times: The Essentials (10th Edition)

Starting Out with C++: Early Objects (7th Edition)

Quaternary Dating Methods

The Discipline of Organizing (Professional Edition)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Unsynchronized producer and consumer processes *-----------------------------------------------------------------------*/ void main(void) { resume( create(consume, 1024, 20, "cons", 0) ); resume( create(produce, 1024, 20, "prod", 0) ); } /*-----------------------------------------------------------------------* produce - Increment n 2000 times and exit *-----------------------------------------------------------------------*/ void produce(void) { int32 i; for( i=1 ; i<=2000 ; i++ ) n++; }.

Our prohibition on busy waiting, think of the implementation. If a process uses the processor while waiting, the processor cannot be executing other processes. At best, the computation will be delayed unnecessarily, and at worst, the waiting process will use all the available processor cycles in a single-core system, and will wind up waiting forever. Many operating systems include coordination functions that applications can use to avoid busy waiting. Xinu provides a semaphore abstraction — the.

Conditions, And Synchronization 27 which takes the desired initial count as an argument, and returns an integer identifier by which the semaphore is known. Consider the example in file ex5.c†. The main process creates two semaphores, consumed and produced, and passes them as arguments to the processes it creates. Because the semaphore named produced begins with a count of 1, wait will not block the first time it is called in cons2. So, the consumer is free to print the initial value of n.

Boots. File semcreate.c contains the code for function newsem as well as function semcreate. Note the use of a static index variable nextsem to optimize searching (i.e., allow a search to start where the last search left off). /* semcreate.c - semcreate, newsem */ #include local sid32 newsem(void); /*-----------------------------------------------------------------------* semcreate - Create a new semaphore and return the ID to the caller.

High-level services. Operating system design is not a well-known craft. In the beginning, because computers were scarce and expensive, only a few programmers had an opportunity to work on operating systems. By the time advances in micro-electronic technology reduced fabrication costs and made personal computers available, operating systems had become commodities, and few programmers need to work on them. Interestingly, microprocessors have become so inexpensive that most electronic devices are.

Download sample

Download